/**
   This file defines some programming style with C++ precompile machanism.
*/
#ifndef _STYLE_HPP_
#define _STYLE_HPP_

template <typename T>
class style
{
 public:
  typedef     const T&                const_reference;
  typedef           T&                reference;
  typedef           T*                pointer;
  typedef           T                 value;
  typedef           unsigned int      u32;
  typedef           unsigned short    u16;
  typedef           unsigned char     u8;
  typedef           void*             addr;
  typedef     const char*             str;
  typedef           void              (*fptr)();
};

//Functions shall use u32 in this way: "type::u32". 
typedef style<int> type; 
#undef  NULL
#define NULL ((void *)0)

#undef  STRUCT
#define STRUCT(name) struct name : style<name> 

#undef CLASS
#define CLASS(name) class name : style<name>

#endif
